package cn.afactory.tygz.ui;

import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.view.Display;
import android.view.View;
import android.widget.ImageView;

import com.lidroid.xutils.bitmap.core.BitmapDecoder;
import com.lidroid.xutils.bitmap.core.BitmapSize;
import com.lidroid.xutils.util.LogUtils;

import cn.afactory.tygz.R;
import cn.afactory.tygz.ui.base.BaseActivity;
import cn.afactory.tygz.ui.base.utils.SPUtils;
import cn.afactory.tygz.ui.guide.GuideActivity;
import cn.afactory.tygz.ui.user.LoginActivity;

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public class LogoActivity extends BaseActivity {
	// 此页面最多展示时间
	private static final int MAX_WAIT_TIME = 3000;
	private static final int MSG_FINISH = 1;
	private Context mContext;
	@Override
	public void handleMessage(Message msg) {
		switch (msg.what) {
			case MSG_FINISH:
				finish();
				break;
		}
	}

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mContext = this;
		setContentView(R.layout.ac_logo);

		showTitleBar(false);

		mUIHandler.sendEmptyMessageDelayed(MSG_FINISH, MAX_WAIT_TIME);
	}

	@Override
	public void finish() {
		mUIHandler.removeMessages(MSG_FINISH);
		super.finish();
		overridePendingTransition(R.anim.right_in, R.anim.left_out);
	}


    @Override
    protected void onDestroy() {
		mUIHandler.removeCallbacksAndMessages(this);
		super.onDestroy();
    }
}